package top.littlejiang.onlinexam.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import top.littlejiang.onlinexam.entity.OlexamClass;
import top.littlejiang.onlinexam.entity.OlexamCourse;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 * 课程表 Mapper 接口
 * </p>
 *
 * @author chen
 * @since 2021-03-11
 */
public interface OlexamCourseMapper extends BaseMapper<OlexamCourse> {

    /**
     * 分页查询
     * @param p
     * @param wrapper
     * @return
     */
    IPage<OlexamCourse> getClassList(Page<OlexamCourse> p, @Param(Constants.WRAPPER) QueryWrapper<OlexamCourse> wrapper);

    /**
     * 根据课程名查找对应班级
     *
     * @param courseName
     * @return
     */
    List<OlexamClass> getClassByCourse(@Param("courseName") String courseName);

}
